package com.ubadong.studentmng.vo;

public abstract class Pager {

	
	//当前页
	private int currentPage=1;
	//总页数
	private int totalPage;
	//每页显示的记录数
	private int pageSize=10;
	//总记录数
	private int counts;
	
	private int offset;
	
	
	public int getOffset() {
		return (currentPage-1) * pageSize;
	}
	
	public void setOffset(int offset) {
		this.offset = offset;
	}
	
	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCounts() {
		return counts;
	}
	public void setCounts(int counts) {
		this.counts = counts;
		
		//计算总页数
		if(counts%pageSize == 0){
			this.totalPage = counts/pageSize;
		}else{
			this.totalPage = counts/pageSize+1;
		}
		
		
	}
	
}

